package net.gd.dao;

import org.apache.log4j.Logger;
import org.springframework.jdbc.core.JdbcTemplate;
import net.gd.domain.UdfModelLog;

public class UdfModelLogDaoImpl extends JdbcTemplate implements UdfModelLogDao {

  private static Logger logger = Logger.getLogger(UdfModelInfoDaoImpl.class);

  @Override
  public void save(UdfModelLog log) {

    String sql = "insert into udf_model_log (log_id,operation_user,operation_type,"
        + "operation_result,operation_status,operation_datetime,model_id,lang_type,"
        + "model_content) values (?,?,?,?,?,?,?,?,?)";
    try {
      this.update(sql, log.getLogId(), log.getOperationUser(), log.getOperationType(),
          log.getOperationResult(), log.getOperationStatus(), log.getOperationDatetime(),
          log.getModelId(), log.getLangType(), log.getModelContent());
      logger.info("operation log save success");
    } catch (Exception e) {
      logger.error("operation log save failed, " + e.getMessage());
    }
  }

}
